package com.eian.boot.common.enums;

import com.eian.boot.common.core.enums.IBaseEnum;
import lombok.Getter;

/**
 * 登录类型枚举
 *
 * @author alex.meng
 * @createTime 2025-10-14
 */
@Getter
public enum LoginTypeEnum implements IBaseEnum<Integer> {

    PASSWORD(1, "账号密码", "用户名密码登录"),
    MOBILE_CODE(2, "手机验证码", "手机验证码登录"),
    EMAIL_CODE(3, "邮箱验证码", "邮箱验证码登录"),
    THIRD_PARTY(4, "第三方登录", "第三方平台登录"),
    QR_CODE(5, "扫码登录", "二维码扫码登录");

    private final Integer value;
    private final String label;
    private final String description;

    LoginTypeEnum(Integer value, String label, String description) {
        this.value = value;
        this.label = label;
        this.description = description;
    }

    public static LoginTypeEnum getByValue(Integer value) {
        return IBaseEnum.getByValue(LoginTypeEnum.class, value);
    }

    public static LoginTypeEnum getByLabel(String label) {
        return IBaseEnum.getByLabel(LoginTypeEnum.class, label);
    }
}

